%% xyps.tex from $Id: xyps.doc,v 2.12 1994/10/25 03:01:14 ross Exp $
%%
%% XY-pic ``PostScript backend''.
%% Copyright (c) 1993-1994 Ross Moore <ross@mpce.mq.edu.au>
%%
%% This file is part of the XY-pic package for graphs and diagrams in TeX.
%% See the companion README and INSTALL files for further information.
%% Copyright (c) 1991-1994 Kristoffer H. Rose <kris@diku.dk>
%%
%% The XY-pic package is free software; you can redistribute it and/or modify
%% it under the terms of the GNU General Public License as published by the
%% Free Software Foundation; either version 2 of the License, or (at your
%% option) any later version.
%%
%% The XY-pic package is distributed in the hope that it will be useful, but
%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
%% for more details.
%%
%% You should have received a copy of the GNU General Public License along
%% with this package; if not, write to the Free Software Foundation, Inc.,
%% 675 Mass Ave, Cambridge, MA 02139, USA.
%%
\ifx\xyloaded\undefined \input xy \fi
\xyprovide{ps}{PostScript backend}{\stripRCS$Revision: 2.12 $}%
 {Ross Moore}{ross@mpce.mq.edu.au}%
 {Mathematics Department, Macquarie University, NSW~2109, Australia}
\xydef@\UsePSspecials{\DNii@{{[4]}}\xyFN@\UsePSspecials@i}
\xydef@\UsePSspecials@i{%
 \ifx \space@\next \expandafter\DN@\space{\xyFN@\UsePSspecials@i}%
 \else\ifx [\next \DN@[##1]{\DNii@{{[##1]}}\xyFN@\UsePSspecials@i}%
 \else\ifcat 5\next \DN@##1{\DNii@{{[##1]}}\xyFN@\UsePSspecials@i}%
 \else\ifx\bgroup\next \DN@{\expandafter\UsePS@specials\nextii@}%
 \else \DN@{\expandafter\UsePS@specials\nextii@{[4]}}%
 \fi\fi\fi\fi \next@ }
\xydef@\UsePS@specials#1#2{%
 \ifx\empty\whichPSspecials@
 \DN@{#2}\ifx\next@\empty
 \else
 \expandafter\let\expandafter\next\csname#2@\endcsname
 \ifx\next\relax \DN@{\xyerror@{PostScript specials for `#2' not supported}{}}%
 \else \DN@{\expandafter\UsePSspecials@\csname#2@\endcsname#1}\fi
 \fi
 \else
 \DN@{#2}\ifx\next@\empty \DN@{\PSspecials@true}%
 \else
 \edef\next@{\expandafter\string\csname#2@\endcsname}%
 \edef\nextii@{\expandafter\string\whichPSspecials@}%
 \ifx\next@\nextii@\DN@{\PSspecials@true}%
 \else
 \ifx\firstPS@@\relax
 \DN@{\xyerror@{Only one PS <driver> allowed: \dvitype@ already loaded}{}}%
 \else
 \expandafter\let\expandafter\next\csname#2@\endcsname
 \ifx\next\relax
 \DN@{\xyerror@{PostScript specials for `#2' not supported}{}}%
 \else 
 \xywarning@{Changing PS <driver> to #2 }%
 \DN@{\expandafter\UsePSspecials@\csname#2@\endcsname#1}%
 \fi
 \fi
 \fi
 \fi
 \fi \next@}
\xydef@\UseDVIPSspecials{\UsePSspecials@\dvips@}
\xydef@\UseTexturesPSspecials{\UsePSspecials@\Textures@}
\xydef@\UseTexturesSpecials{\UsePSspecials@\Textures@}
\xydef@\UsePostScriptSpecials{\UsePSspecials@\dvips@}
\xydef@\UseOzTeXspecials{\UsePSspecials@\OzTeX@}
\xydef@\UseDVITOPSspecials{\UsePSspecials@\dvitops@}
\message{drivers,}
\xydef@\loadPSdriver@#1#2{\xyinputorelse@{xy#1.tex}%
 {\xyerror@{Unable to load xy#1.tex for #2 driver}{}}}
\xydef@\dvips@{\loadPSdriver@{ps-dvi}{dvips}}
\xydef@\Textures@{\loadPSdriver@{ps-txt}{Textures}}
\xydef@\OzTeX@{\loadPSdriver@{ps-oz}{OzTeX}}
\xydef@\dvitops@{\loadPSdriver@{ps-dto}{dvitops}}
\xydef@\dvipsone@{\loadPSdriver@{ps-one}{dvipsone}}
\xydef@\dviwindo@{\loadPSdriver@{ps-wdo}{dviwindo}}
\xydef@\pubps@{\loadPSdriver@{ps-pub}{pubps}}
\global\newif\ifPSspecials@ 
\xydef@\UsePSspecials@#1{\gdef\whichPSspecials@{#1}\xyFN@\PSspecials@}
\xydef@\whichPSspecials@{}
\xydef@\NoPSspecials{\xywarning@{PostScript switched off.}%
 \PSspecials@false\aftergroup\resetPS@}
\xydef@\resetPS@{\ifPSspecials@\xywarning@{PostScript switched back on.}\fi}
\xydef@\xyPSraw@{%
 \ifPSspecials@\expandafter\PSraw@\else\expandafter\eat@\fi }
\xydef@\dvimessage@{%
 \xywarning@{The produced DVI file is NOT PORTABLE:^^J
 It contains PostScript \string\special s for the \dvitype@ driver%
 \PSheadermessage@}}
\xywarnifdefined\dvitype@
\xydef@\PSheadermessage@{}
\xydef@\PSspecials@{%
 \ifx\next[\DN@[##1]{\setxyPSlevel@{##1}\xyFN@\PSspecials@}%
 \else\DN@{\whichPSspecials@\PSspecials@@}%
 \fi \next@ }%
\xydef@\PSspecials@@{%
 \ifx\und@fined\PSmessage\hidePSmessages\fi \setupxyPS@}
\xydef@\setupxyPSlevelO@{\relax}
\xydef@\setxyPSlevel@#1{\ifcase#1%
 \gdef\setupxyPS@{\setupxyPSlevelO@}%
 \or\gdef\setupxyPS@{\setupxyPSlevelA@}%
 \or\gdef\setupxyPS@{\setupxyPSlevelB@}%
 \or\gdef\setupxyPS@{\setupxyPSlevelC@}%
 \or\gdef\setupxyPS@{\setupxyPSlevelD@}%
 \else\gdef\setupxyPS@{\setupxyPSlevelD@}\fi }
\xywarnifdefined\setupxyPS@ \gdef\setupxyPS@{\setupxyPSlevelD@}
\xydef@\PSincrease@#1{%
 \xywarning@{The PS level may only increase: #1 is already active}}
\xywarnifdefined\xyPSdictname
\xydef@\xyPSdefaultdict{%
 \DN@##1.##2.##3@{\gdef\xyPSdictname{xy##1##2dict.ps}}%
 \expandafter\next@\xyversion.@}
\xydef@\UsePSheader@#1{%
 \DN@{#1}\ifx\next@\empty
 \ifx\xyPSdictname\undefined\xyPSdefaultdict\fi
 \else \gdef\xyPSdictname{#1}\fi
 \gdef\PSheadermessage@{.^^J
 It includes a reference to the PostScript file \xyPSdictname}%
 \UsePSdict@@true } 
\xynew@{if}\ifUsePSdict@@
\xylet@\UsePSheader=\UsePSheader@
\xydef@\dumpPSdict#1{\DN@{#1}\ifx\next@\empty
 \ifx\undefined\xyPSdictname\xyPSdefaultdict\fi
 \else\gdef\xyPSdictname{#1}\fi \writePSdict@@ }%
\xydef@\firstPS@{\ifx\firstPS@@\relax\else\global\let\firstPS@@=\relax\fi}
\xylet@\firstPS@@=\firstPS@
\xydef@\includeXYPSdict@{%
 \expandafter\PSinclude@\expandafter{\xyPSdictname}}
\xylet@\includeXYPSdict=\includeXYPSdict@
\xydef@\endXYdict@{}
\xydef@\includePSmessage@{\message{<xyps: including \xyPSdictname}}
\xydef@\xyPSdictknown@{%
 \immediate\closein\xyread@
 \xywarning@{File \xyPSdictname\space already exists}
 \message{ Do you wish to overwrite it \string? y/n }%
 \read16 to \next
 \DNii@{\xywarning@{You did not type Y or N -- try again please}%
 \xyPSdictknown@}%
 \DN@{Y }\ifx\next@\next \DNii@{\writePSdict@@}%
 \else\DN@{y }\ifx\next@\next \DNii@{\writePSdict@@}%
 \else\DN@{n }\ifx\next@\next \DNii@{\cancelPSdict@}%
 \else\DN@{N }\ifx\next@\next \DNii@{\cancelPSdict@}%
 \fi\fi\fi\fi \nextii@
}
\xydef@\cancelPSdict@{%
 \xywarning@{cancelling dump of PostScript dictionary}}
\xydef@\noDictmessage@{%
 \xywarning@{xyps \dvitype@ does not support the use of a header file}}
\xywarnifdefined\xyPS@@
\xywarnifdefined\xyPS@@@
{\catcode`|=14 \catcode`\%=12 \catcode`\<=1 \catcode`\>=2 |
 \gdef\xyPS@@<%%>\gdef\xyPS@@@<%!>}
\xywarnifdefined\writePSdict@@ 
{\catcode`|=14 \catcode`\%=12 
 \gdef\writePSdict@@{{|
 \immediate\openout\xywrite@=\xyPSdictname \relax
 \message{<xyps: dumping \xyPSdictname}|
 \def\PSdict@@##1{\immediate\write\xywrite@{##1}}|
 \let\xyPSobeylines@=\obeyoutlines@
 \let\firstPS@@=\relax
 \let\endXYdict@=\relax
 \PSdict@@{\xyPS@@@ PS-Adobe-3.0 Resource-procset}|
 \PSdict@@{\xyPS@@ Title: \xyPSdictname}|
 \PSdict@@{\xyPS@@ Version: \stripRCS$Revision: 2.12 $}|
 \PSdict@@{\xyPS@@ Creator: XY-ps backend to XY-pic}|
 \PSdict@@{\xyPS@@ DocumentSuppliedProcSets: XYdict}|
 \ifx\dvitype@\undefined
 \PSdict@@{\xyPS@@ For: use with XY-pic}\else
 \PSdict@@{\xyPS@@ For: \dvitype@ use of XY-pic}\fi
 \PSdict@@{\xyPS@@ BeginResource: procset XYdict}|
 \def\PSspecial@##1{\PSdict@@{##1^^J}}|
 \def\PSdict@##1{|
 \immediate\write\xywrite@{XYdict begin^^J^^J##1}|
 \let\PSdict@=\PSdict@@ }|
 \XYdict@
 \PSdict@@{end}|
 \PSdict@@{\xyPS@@ EndResource}|
 \immediate\closeout\xywrite@
 \message{>}|
 }}}
\xywarnifdefined\obeyoutlines@
{\catcode`\^^M=\active
 \gdef\obeyoutlines@{\catcode`\^^M=\active \def^^M{^^J}%
 \newlinechar=`\^^J\obeyspaces}}
\xydef@\xyPSshipout@{\setbox9=\copy\voidb@x
 \afterassignment\xyPSshipout@i\setbox9=}
\xydef@\xyPSshipout@i{\ifvoid9 \expandafter\aftergroup\fi\xyPSshipout@ii}
\xydef@\xyPSshipout@ii{\TeX@shipout\vbox{\XYdict@\box9}}
\xywarnifdefined\TeX@shipout 
\xydef@\@PSshipout{%
 \global\let\TeX@shipout=\shipout
 \global\let\shipout=\xyPSshipout@ }
\xydef@\PSmacro@#1{\relax}
\xydef@\PSdict@#1{\relax}
\xydef@\PSspecial@#1{\relax}
\xydef@\PSread@#1{\relax}
\xydef@\PSinclude@#1{\relax}
\xydefcsname@{*shapechar@!@}#1{\ifxyPSshapes@\DN@{\xyPSshapechar@{#1}@@}%
 \else \DN@{\xyPScharwarning@@}\fi \next@ }
\xydefcsname@{*shape@psxy@}{\ifxyPSshapes@\DN@{\xyPSpsxy@}%
 \else \DN@{\xyPScharwarning@@}\fi \next@ }
\xydef@\xyPSpsxy@{%
 \setboxz@h{\dimen@=\Lp \advance\dimen@-\Rp 
 \dimen@ii=-\Up \raise\dimen@ii\hbox to\z@{%
 \kern\dimen@\xyPScurrpt@\kern-\dimen@}\boxz@}}%
\xydef@\xyPScurrpt@{\ifxyPSshapes@\expandafter\xyPScurrpt@@\fi}
\xydef@\xyPScurrpt@@{\PSspecial@{userdict begin 
 0 0 transform grestore gsave itransform
 /xyYpos exch def /xyXpos exch def end}}
\xywarnifdefined\xyPSshapechar@
\xywarnifdefined\xyPSsplitshape@
{\xyuncatcodes \catcode`@=11
 \gdef\xyPSshapechar@#1@@{\xyPSsplitshape@#1<><>@@}%
 \gdef\xyPSsplitshape@#1<>#2<>#3@@{\xyPSsplitPS@{#1}{#2}}}
\xydef@\xyPSsplitPS@#1#2{\def\xyPSpre@{#1}\def\xyPSpost@{#2}\modPSboxz@ }
\xydef@\xyPSrawA@#1{\xyPSraw@{gsave mark{xypush #1}xy}}%
\xydef@\xyPSrawZ@#1{%
 \xyPSraw@{currentfont mark{#1 xypop}xy grestore setfont}}%
\xydef@\modPSboxz@{%
 \setboxz@h{\xyPSrawA@\xyPSpre@\boxz@\xyPSrawZ@\xyPSpost@}}%
\xydef@\modPSdrop@{%
 \expandafter\DNii@\expandafter{%
 \expandafter\xyPSrawA@\expandafter{\xyPSpre@}}%
 \DN@##1{\expandafter\def\expandafter\tmp@\expandafter{\nextii@ ##1}}%
 \expandafter\next@\expandafter{\Drop@@}%
 \expandafter\DNii@\expandafter{%
 \expandafter\xyPSrawZ@\expandafter{\xyPSpost@}}%
 \DN@##1{\expandafter\def\expandafter\Drop@@\expandafter{\tmp@ ##1}}%
 \expandafter\next@\expandafter{\nextii@}}%
\xydef@\modPSconnect@{%
 \expandafter\DNii@\expandafter{%
 \expandafter\xyPSrawA@\expandafter{\xyPSpre@}}%
 \DN@##1{\expandafter\def\expandafter\tmp@\expandafter{\nextii@ ##1}}%
 \expandafter\next@\expandafter{\Connect@@}%
 \expandafter\DNii@\expandafter{%
 \expandafter\xyPSrawZ@\expandafter{\xyPSpost@}}%
 \DN@##1{\expandafter\def\expandafter\Connect@@\expandafter{\tmp@ ##1}}%
 \expandafter\next@\expandafter{\nextii@}}%
\xydef@\xyPSpre@{}
\xydef@\xyPSpost@{}
\message{hooks,}
\xydef@\PSmessage@#1{\W@{postscript: #1, direction=\the\Direction}}
\xydef@\PSignore@#1{}%
\xydef@\showPSmessages{\let\PSmessage=\PSmessage@}
\xydef@\hidePSmessages{\let\PSmessage=\PSignore@}
\xylet@\PStracing=\showPSmessages
\hidePSmessages
\gdef\xyPSalternative@#1#2{%
\expandafter\global\expandafter\let\csname origxy#2@\endcsname=#1%
 \xdef#1{\noexpand\ifPSspecials@
 \noexpand\expandafter\expandafter\noexpand\csname xyPS#2@\endcsname
 \noexpand\else
 \noexpand\expandafter\expandafter\noexpand\csname origxy#2@\endcsname
 \noexpand\fi}}%
\xydef@\setupxyPSlevelA@{%
 \xyPSalternative@{\tip@@}{tip}%
 \xyPSalternative@{\atip@@}{atip}%
 \xyPSalternative@{\btip@@}{btip}%
 \xyPSalternative@{\Tip@@}{Tip}%
 \xyPSalternative@{\Ttip@@}{Ttip}%
 \xyPSalternative@{\hook@@}{hook}%
 \xyPSalternative@{\ahook@@}{ahook}%
 \xyPSalternative@{\bhook@@}{bhook}%
 \xyPSalternative@{\aturn@@}{aturn}%
 \xyPSalternative@{\bturn@@}{bturn}%
 \xyPSalternative@{\squiggle@@}{squiggle}%
 \xyPSalternative@{\stopper@@}{stopper}%
 \xyPSalternative@{\line@@}{dash}%
 \xyPSalternative@{\circhar@@}{circhar@}%
 \xywithoption{cmtip}{\xyPScmtips@}%
 \gdef\setupxyPSlevelA@{\PSincrease@{1}}%
 \PSspecials@true}
\xydef@\setupxyPSlevelB@{%
 \let\xyPSfont@=\empty \let\xyPSsemifont@=\empty
 \xyPSalternative@{\cirrestrict@@}{cirrest}%
 \gdef\setupxyPSlevelB@{\PSincrease@{2}}%
 \setupxyPSlevelA@ }
\xydef@\setupxyPSlevelC@{%
 \xyPSalternative@{\cirbuild@}{cirbuild}%
 \xyPSalternative@{\CIRfull@}{CIRfull}%
 \xyPSalternative@{\solid@}{solid}%
 \xyPSalternative@{\point@}{point}%
 \xywithoption{curve}{%
 \xyPSalternative@{\splinesolid@}{splinesolid}}%
 \gdef\setupxyPSlevelC@{\PSincrease@{3}}%
 \setupxyPSlevelB@ }%
\xydef@\setupxyPSlevelD@{%
 \xyPSalternative@{\dash@}{dashed}%
 \xywithoption{curve}{%
 \xyPSalternative@{\splinedashed@}{splinedashed}%
 \xyPSalternative@{\splinedotted@}{splinedotted}}%
 \gdef\setupxyPSlevelD@{\PSincrease@{4}}%
 \setupxyPSlevelC@ }
\xydef@\xyPSchar@#1{%
 \PSmessage{\the\Direction\space #1}%
 \PSmacro@{\the\Direction\space \xyPSfont@ #1}}
\xydef@\xyPSsemichar@#1{%
 \PSmessage{\the\Direction\space\xyPSsemifont@ #1}%
 \PSmacro@{\the\Direction\space \xyPSsemifont@ #1}}
\xydef@\xyPSfont@{xyfont }
\xydef@\xyPSsemifont@{xysdfont }
\xydef@\xyPStip@{\xyPSchar@{tip}}%
\xydef@\xyPSatip@{\xyPSchar@{atip}}%
\xydef@\xyPSbtip@{\xyPSchar@{btip}}%
\xydef@\xyPSTip@{\xyPSchar@{Tip}}%
\xydef@\xyPSTtip@{\xyPSchar@{Ttip}}
\xydef@\xyPScmtips@{\xyPSalternative@{\xycm@}{cm}}%
\xydef@\xyPScm@\tip@x{\xyFN@\xyPScm@@}%
\xydef@\xyPScm@@{%
 \ifx\next\tip@@ \DN@\tip@@{\tip@x\xyPScmtip@}%
 \else\ifx\next\atip@@ \DN@\atip@@{\tip@x\xyPScmatip@}%
 \else\ifx\next\btip@@ \DN@\btip@@{\tip@x\xyPScmbtip@}%
 \else\DN@{}%
 \fi\fi\fi \next@}%
\xydef@\xyPScmtip@{\xyPSchar@{cmtip}}%
\xydef@\xyPScmatip@{\xyPSchar@{cmatip}}%
\xydef@\xyPScmbtip@{\xyPSchar@{cmbtip}}%
\xydef@\xyPShook@{\xyPSchar@{hook}}
\xydef@\xyPSahook@{\xyPSchar@{ahook}}
\xydef@\xyPSbhook@{\xyPSchar@{bhook}}
\xydef@\xyPSaturn@{\xyPSchar@{aturn}}
\xydef@\xyPSbturn@{\xyPSchar@{bturn}}
\xydef@\xyPSsquiggle@{\xyPSchar@{squigl}}
\xydef@\xyPSstopper@{\xyPSchar@{stopper}}
\xydef@\xyPSfliptrue@{\DN@{\xyPSsemichar@{true dash}}}
\xydef@\xyPSdash@{%
 \DN@{\xyPSsemichar@{false dash}}%
 \ifnum\SemiDirectionChar=31
 \ifdim\dY<\z@ 
 \ifdim\dX<\z@ \ifx\xyPSsemifont@\empty\xyPSfliptrue@\fi\fi
 \else
 \ifdim\z@>\dX 
 \ifx\xyPSsemifont@\empty\else\xyPSfliptrue@\fi
 \else\xyPSfliptrue@\fi
 \fi\fi
 \next@ \setboxz@h{\origxydash@}\kern\wdz@ 
 \setbox\z@=\box\voidb@x }
\xydef@\xyPScirchar@#1{\count@=#1\edef\tmp@{\the\count@}%
 \ifcase#1%
 \xyPScirchar@@@{-180}{-135}{\tmp@}\dimen@=.2929\R@
 \or\xyPScirchar@@@{-135}{-90}{\tmp@}\dimen@=.7071\R@
 \or\xyPScirchar@@@{-90}{-45}{\tmp@}\dimen@=.7071\R@
 \or\xyPScirchar@@@{-45}0{\tmp@}\dimen@=.2929\R@
 \or\xyPScirchar@@@0{45}{\tmp@}\dimen@=.2929\R@
 \or\xyPScirchar@@@{45}{90}{\tmp@}\dimen@=.7071\R@
 \or\xyPScirchar@@@{90}{135}{\tmp@}\dimen@=.7071\R@
 \or\xyPScirchar@@@{135}{180}{\tmp@}\dimen@=.2929\R@
 \fi}
\xydef@\xyPScirrest@{\relax}%
\xydef@\xyPScirchar@@#1{\relax\count@=#1\edef\tmp@{\the\count@}%
 \expandafter\xyPScirchar@@@\ifcase#1%
 {-180}{-135}{\tmp@}\kern.2929\R@\or{-135}{-90}{\tmp@}\kern.7071\R@%
 \or{-90}{-45}{\tmp@}\kern.7071\R@ \or{-45}0{\tmp@}\kern.2929\R@%
 \or 0{45}{\tmp@}\kern.2929\R@ \or{45}{90}{\tmp@}\kern.7071\R@%
 \or{90}{135}{\tmp@}\kern.7071\R@\or{135}{180}{\tmp@}\kern.2929\R@%
 \fi}%
\xydef@\xyPScirchar@@@#1#2#3{\edef\tmp@{#1\space#2\space
 \expandafter\removePT@\the\R@\space #3\space circhar}%
 \PSmessage{\tmp@}\PSmacro@{\tmp@}}
\xydef@\xyPScirc@#1#2{\edef\tmp@{\expandafter\removePT@\the\R@}%
 \PSmessage{\tmp@\space #1 #2 circ}\PSmacro@{\tmp@\space #1 #2 circ}}
\xydef@\xyPSCIRfull@{\setboxz@h{\kern\R@\xyPScirc@0{360}\kern\R@}%
 \wd\z@=\z@ \ht\z@=\R@ \dp\z@=\R@ \boxz@}%
\xydef@\xyPScirbuild@{{%
 \count@=\CIRlo@@ \count@@=\CIRhi@@ 
 \multiply\count@ by45 \advance\count@-180 \relax
 \multiply\count@@ by45 \advance\count@@-180 \relax
 \def\tmp@{}%
 \ifx\CIRtest@@\CIRtest@inside 
 \ifnum\count@@>\count@
 \edef\tmp@{\noexpand\xyPScirc@{\the\count@}{\the\count@@}}\fi
 \else\ifx\CIRtest@@\CIRtest@outside
 \ifnum\count@>-180 \advance\count@ by360 \relax
 \edef\tmp@{\noexpand\xyPScirc@{\the\count@@}{\the\count@}}%
 \else
 \ifnum\count@@<180 \relax
 \edef\tmp@{\noexpand\xyPScirc@{\the\count@@}{180}}%
 \fi\fi
 \fi\fi
 \kern\R@\tmp@\kern\R@}}
\xydef@\xyPSstraight@#1{\setupDirection@
 \edef\Creset@@{\cfromthec@ \pfromthep@ \DirectionfromtheDirection@}%
 \DN@##1##2{\def\checkoverlap@@{%
 \ifdim##1\Xp>##1\Xc \let\next@=\relax \fi
 \ifdim##2\Yp>##2\Yc \let\next@=\relax \fi}}%
 \edef\nextii@{{\sdX}{\sdY}}\expandafter\next@\nextii@
 \noCshavep@@
 \edef\Cshavep@@{\pfromthep@ \noexpand\resetDirection@}%
 \noCshavec@@
 \edef\Cshavec@@{\cfromthec@ \noexpand\resetDirection@}%
 \ifHidden@\else
 \ifdim\Yc>\Ymax \Ymax=\Yc \fi \ifdim\Yp>\Ymax \Ymax=\Yp \fi
 \ifdim\Yc<\Ymin \Ymin=\Yc \fi \ifdim\Yp<\Ymin \Ymin=\Yp \fi
 \ifdim\Xc>\Xmax \Xmax=\Xc \fi \ifdim\Xp>\Xmax \Xmax=\Xp \fi
 \ifdim\Xc<\Xmin \Xmin=\Xc \fi \ifdim\Xp<\Xmin \Xmin=\Xp \fi \fi
 \ifInvisible@\let\next@=\relax \else
 \DN@{\setboxz@h{\kern\Xc \raise\Yc\hbox{#1}}%
 \ht\z@=\z@ \wd\z@=\z@ \dp\z@=\z@ {\Drop@@}}%
 \fi 
 \checkoverlap@@
 \ifdim\dX=\z@ \ifdim\dY=\z@ \DN@{\relax}\fi\fi \next@
 \def\Cslidep@@{\noCslidep@@}\def\Cslidec@@{\noCslidec@@}%
 \def\Calong@@{\noCalong@@}\Creset@@ }
\xydef@\xyPSsolid@{%
 \ifInvisible@ \let\next@=\no@@
 \else \DN@{\xyPSstraight@\xyPSsolid@@@}\fi
 \next@ }
\xydef@\xyPSsolid@@@{\edef\tmp@{%
 \expandafter\removePT@\the\dX\space\expandafter\removePT@\the\dY}%
 \PSmessage{solid line: \tmp@}\PSmacro@{\tmp@\space solid}}
\xydef@\xyPSsolid@@{\ifdim\dX=\z@ \DN@{\xyPSvert@}%
 \else\ifdim\dY=\z@ \DN@{\xyPShoriz@}\else \DN@{\xyPSsolid@@@}\fi\fi
 \next@}%
\xydef@\xyPSvert@{%
 \B@=\dp\lastobjectbox@ \advance\B@\ht\lastobjectbox@
 \ifdim \B@=\z@ \count@@=\m@ne
 \else \dimen@=\sdY\dY \divide\dimen@\B@ \count@@=\dimen@ \fi
 \ifnum\count@@=\z@ \DN@{}\else \DN@{\xyPSsolid@@@}\fi
 \next@ }
\xydef@\xyPShoriz@{%
 \A@=\wd\lastobjectbox@
 \ifdim \A@=\z@ \count@@=\m@ne
 \else \dimen@=\sdX\dX \divide\dimen@\A@ \count@@=\dimen@ \fi
 \ifnum\count@@=\z@ \DN@{}%
 \else \DN@{\xyPSsolid@@@}\fi
\next@ }
\xydef@\xyPSdashed@{\line@ \def\Connect@@{\xyPSstraight@\xyPSdashed@@}}
\xydef@\xyPSdashed@@{\edef\tmp@{%
 \expandafter\removePT@\the\dX\space\expandafter\removePT@\the\dY }%
 \PSmessage{dashed line: \tmp@}\PSmacro@{\tmp@\space dashed}}
\xydef@\xyPSpoint@{\xyPSzerodot@\egroup
 \Invisible@false \Hidden@false \def\Leftness@{.5}\def\Upness@{.5}\ctipEdge@
 \def\Drop@@{\boxz@}\def\Connect@@{\xyPSstraight@\xyPSdotted@}}
\xydef@\xyPSdotted@{\edef\tmp@{%
 \expandafter\removePT@\the\dX\space\expandafter\removePT@\the\dY }%
 \PSmessage{dotted line: \tmp@}\PSmacro@{\tmp@\space dotted}}
\xydef@\xyPSzerodot@{\PSmessage{dot}\PSmacro@{dot}}
\xynew@{if}\ifxyPSshapes@ \xyPSshapes@false 
\xydef@\xyPScharwarning@@{\xyPScharmessage@
 \gdef\xyPScharwarning@@{\xyPScharmessage@
 \xywarning@{...no further PostScript warnings will be given.}%
 \global\let\xyPScharwarning@@=\relax }}
\xydef@\xyPScharmessage@{%
 \xywarning@{Current driver does not support PostScript effects.}}%
\xydef@\newxyshape#1#2#3{%
 \DN@{#3}\ifx\next@\empty
 \xydefcsname@{*shape@#1@}{\csname xyshape@#1@\endcsname}%
 \else \expandafter\def\csname*shape@#1@\endcsname{%
 \csname xyshape@#1@\endcsname}\fi
 \DN@{#2}\ifx\next@\empty
 \expandafter\def\csname xyshape@#1@\endcsname{%
 \xyundefinedEffect@{#1}{}@@}%
 \else \expandafter\def\csname xyshape@#1@\endcsname{#2}\fi }
\xydef@\xyundefinedEffect@#1#2@@{%
 \xywarning@{The #1 #2 effect is not implemented with the current driver.}}%
\xydef@\newxyPSshape#1#2{%
 \expandafter\DN@\expandafter{\csname *shape@#1@\endcsname}%
 \DNii@{\relax}\ifx\next@\nextii@ \newxyshape{#1}{}\relax\fi
 \expandafter\DNii@\expandafter{\csname xyPSshape@#1@\endcsname}%
 \expandafter\def\nextii@{#2}%
 \ifx\nextii@\empty\expandafter\def\next@{\xyPSnotimplemented@@`#1'@@}%
 \else
 \edef\tmp@{\noexpand\let\expandafter\noexpand\next@
 \expandafter\noexpand\nextii@}\expandafter\tmp@\fi }
\xydef@\xyPSnotimplemented@@#1@@{%
 \xywarning@{This PostScript effect is not implemented yet.}}%
\xydef@\xyPSnotfinished@@{%
 \xywarning@{This effect is not reliable yet; box sizes may be wrong.}}%
\xydef@\xyPSdashhfill@{{\SemiDirectionChar=95 \Direction=3072 \xyPSdash@}}
\xydef@\xyPSdashvfill@{{\SemiDirection=31 \Direction=1023 \xyPSdash@}}
\xydef@\xyPScircled@#1{{\R@=#1\relax 
 \setboxz@h{\dimen@=\Xc\advance\dimen@-\Rc\kern\dimen@
 \raise\Yc\hbox{\xyPSCIRfull@}}%
 \ht\z@=\z@ \dp\z@=\z@ \wd\z@=\z@ \boxz@}}
\xydef@\xyPScubic@#1{\readsplineparams@
 \PSmacro@{mark \cubicinfo@\space #1cubic}%
 \PSmessage{\cubicinfo@\space #1cubic}%
}
\xydef@\xyPSsquine@#1{\readsplineparams@
 \PSmacro@{mark \squineinfo@\space #1squine}%
 \PSmessage{\squineinfo@\space squine}%
}
\xydef@\xyPSsplinesolid@{\ifx\splineinfo@\squineinfo@
 \expandafter\xyPSsquine@\else\expandafter\xyPScubic@\fi{}}
\xydef@\xyPSsplinedashed@{\ifx\splineinfo@\squineinfo@
 \expandafter\xyPSsquine@\else\expandafter\xyPScubic@\fi{dash}}
\xydef@\xyPSsplinedotted@{\ifx\splineinfo@\squineinfo@
 \expandafter\xyPSsquine@\else\expandafter\xyPScubic@\fi{dot}}
\xywithoption{line}{%
 \xyinputorelse@{xyps-l}{\xyerror@{Could not load xyps-l}{}}}%
\xycatcodes
\xywithoption{color}{%
 \xyinputorelse@{xyps-c}{\xyerror@{Could not load xyps-c}{}}}%
\xycatcodes
\xywithoption{rotate}{%
 \xyinputorelse@{xyps-r}{\xyerror@{Could not load xyps-r}{}}}%
\xycatcodes
\message{dictionary,}
\xywarnifdefined\xyPSobeylines@
\xywarnifdefined\xyPSendline@@
{\catcode`\^^M=\active
\gdef\XYdict@{{\xyPSobeylines@%
\count@=\xydashl@\relax%
\count@@=\xydashw@\relax%
\let\PSfirst@@=\relax%
\PSspecial@{%
 /XYdict where not{200 dict /XYdict exch def 
 /xy{XYdict begin countdictstack /xylevel exch def
 xyopen xycolor stopped xyclose cleartomark end}def 
 /xyc{{xysetcol}xy}def /xycc{{xychgcol}xy}def XYdict}if
 begin
 /xyopen{currentdict /XYddict known{XYddict null eq{}%
 {XYddict begin xyopen}ifelse}if}def
 /xyclose{countdictstack -1 xylevel 1 add{pop end}for}def
 /xycolor{0 setgray}bind def
 end
}%
\PSdict@{%
 /xyopen{currentdict /XYddict known{XYddict null eq{}%
 {XYddict begin xyopen}ifelse}if}def
 /xycolor{0 setgray}bind def
}%
\PSdict@{%
 /xyclose{countdictstack -1 xylevel 1 add{pop end}for}def
 /xypush{8 dict /XYddict exch def XYddict begin}def
 /undef where
 {pop /xypop{countdictstack xylevel eq{}{end}ifelse
 currentdict /XYddict undef}def}%
 {/xypop{countdictstack xylevel eq{}{end}ifelse
 /XYddict null def}def}ifelse
}%
\PSdict@{%
 /xychgcol{/xycolor exch def}def
 /xysetcol{xypush xychgcol}def
}%
\PSdict@{%
 /xysize 10 def 
 /xypspt{72 72.27 div dup scale}bind def
 /dimendiv{65536 div}bind def 
 /xysegl \number\count@\space dimendiv def 
 /xyopp{1 -1 scale}bind def 
}%
\PSdict@{%
 /pscorrect{.85 mul}bind def 
 /xy{countdictstack /xylevel exch def xyopen xycolor stopped
 xyclose cleartomark}def 
 /xywidth{\number\count@@\space dimendiv pscorrect setlinewidth}bind def 
 /xydash{[] 0 setdash}bind def 
 /xycap{1 setlinecap}bind def
 /xyjoin{1 setlinejoin}bind def
 /xycolor{0 setgray}bind def
}%
\PSdict@{%
 /xyfont{4096 add 64 div round 64 mul 4096 sub}def 
 /xysdfont{4096 add 32 div round 32 mul 4096 sub}def 
 /xydots{xywidth 1 setlinecap [0 2] 0 setdash}bind def 
}%
\PSdict@{%
 /setupDirection{dup -2048 lt{3072 add neg 1024 exch}
 {dup 0 lt{1024 add neg -1024}{dup 2048 lt{1024 sub -1024 exch}
 {3072 sub 1024}ifelse}ifelse}ifelse atan 
 dup 180 gt{360 sub}if dup /XYdirection exch def rotate}def
}%
\PSdict@{%
 /xyCheckDir{dup 8 div 3 mul 3 -1 roll sub neg exch div 360 mul 
 dup dup XYdirection sub 180 div round 180 mul XYdirection add 
 dup 3 -1 roll sub abs 10 gt not{exch}if pop}def 
}%
\ifdim\xydashw@=0pt\xydashw@=.4pt\fi%
\count@@=\xydashw@\relax%
\PSdict@{%
 /xyrulth{\number\count@@\space dimendiv pscorrect setlinewidth 
 0 setlinecap}bind def
}%
\PSdict@{%
 /gsavexy{gsave xypspt XYdirection rotate xywidth newpath 0 0 moveto}def 
 /gchksavexy{gsave xypspt setupDirection xywidth newpath 0 0 moveto}def 
}%
\PSdict@{%
 /gstartxy{gsave xypspt xywidth xycap xyjoin newpath 0 0 moveto}def 
 /grulexy{gsave xyrulth newpath 0 0 moveto}def 
 /xystroke{stroke grestore}bind def 
}%
\PSdict@{%
 /arc4pop{arcto 4{pop}repeat}bind def 
 /xyswap{XYdirection 180 add /XYdirection exch def}def 
}%
\PSdict@{%
 /xyline{gstartxy setupDirection rlineto xystroke}def 
 /dash{exch gchksavexy xysegl XYdirection dup 
 -90 lt{pop neg}{90 gt{neg}if}ifelse exch{neg}if
 0 rlineto xystroke}def 
 /stopper{gstartxy setupDirection 0 xysegl 2 div rmoveto 
 0 xysegl neg rlineto xystroke }def }%
\PSdict@{%
 /solid{gstartxy xydash xycap neg exch neg exch rlineto xystroke}def 
 /dashed{gstartxy 2 copy dup mul exch dup mul add sqrt dup 
 xysegl add xysegl 2 mul div round 2 mul 1 sub div [ exch dup ] 0 setdash 
 xycap neg exch neg exch rlineto xystroke}def
}%
\PSdict@{%
 /dot{gstartxy 2 setlinecap [0 2] 0 setdash 
 1 0 rlineto xystroke}def 
 /dotted{gstartxy 2 copy dup mul exch dup mul add sqrt dup 
 2 div round 1 add div 2 setlinecap [0 3 -1 roll] 0 setdash 
 neg exch neg exch rlineto 0 0 rlineto xystroke}def
}%
\PSdict@{%
 /cubic{gstartxy xycap docubic} def 
 /docubic{chkvalid 
 {chkcubedge 8 -2 roll moveto curveto xystroke pop}
 {cleartomark grestore}ifelse}def 
 /chkcubedge{2 copy 1.0 eq{0.0 eq{pop pop}{cubicedge}ifelse}
 {pop cubicedge}ifelse}def
}%
\PSdict@{%
 /dotcubic{gstartxy 1 setlinecap [0 2] 0 setdash docubic}def 
 /dashcubic{gstartxy xycap [5 5] 0 setdash docubic}def 
}%
\PSdict@{%
 /squine{gstartxy xycap dosquine}def 
 /dosquine{chkvalid 
 {chksquedge 2 copy moveto xysq2cub curveto xystroke pop}
 {cleartomark grestore}ifelse}def
}%
\PSdict@{%
 /chkvalid{2 copy lt{dup 1 gt{false}{true}ifelse}{false}ifelse}def 
}%
\PSdict@{%
 /chksquedge{2 copy 1.0 eq{0.0 eq{pop pop}{squineedge}ifelse}
 {pop squineedge}ifelse}def 
 /xysq2cub{xysq2cubit 6 1 roll xysq2cubit 6 1 roll 3 index 3 index 
 xysq2cubit 6 1 roll xysq2cubit 6 1 roll pop pop}def 
 /xysq2cubit{2 index 2 mul add 3 div}def 
}%
\PSdict@{%
 /dotsquine{gstartxy 1 setlinecap [0 2] 0 setdash dosquine}def 
 /dashsquine{gstartxy xycap [5 5] 0 setdash dosquine}def 
}%
\PSdict@{%
/xy4mul{8 copy 
 5 -1 roll mul 5 1 roll 6 -1 roll mul 6 1 roll 
 3 -1 roll mul exch 4 -1 roll mul 3 1 roll 
 add 3 1 roll add exch 10 2 roll 
 7 -1 roll mul 7 1 roll 4 -1 roll mul 5 1 roll 
 4 -1 roll mul 4 1 roll mul add 3 1 roll add 
 exch 3 -1 roll }def }%
\PSdict@{%
 /xy44mul{
 4 copy 16 4 roll exch 3 1 roll 4 copy 12 4 roll
 xy4mul 12 4 roll xy4mul 12 -4 roll 4 copy 16 4 roll
 8 4 roll xy4mul 12 4 roll xy4mul}def
}%
\PSdict@{%
 /cubicedge{10 2 roll
 exch 8 1 roll 3 -1 roll dup dup 9 2 roll
 5 -1 roll dup dup 9 1 roll 8 3 roll
 4 1 roll dup dup 5 3 roll dup dup 5 1 roll 3 -1 roll
 18 -2 roll 2 copy 1 sub neg 4 1 roll 1 sub neg exch 4 1 roll
 xy444mul
 pop pop pop 13 1 roll pop pop pop 9 1 roll
 10 1 roll pop 8 1 roll 7 1 roll 8 1 roll pop 5 1 roll 3 1 roll
 }def
}%
\PSdict@{%
 /xy444mul{
 4 copy 24 4 roll 12 -4 roll 16 4 roll 4 copy 16 4 roll
 xy44mul 20 8 roll xy44mul
 12 -4 roll
 4 -1 roll 7 1 roll exch 4 1 roll exch 6 -1 roll exch 4 2 roll
 16 8 roll 8 4 roll
 4 -1 roll 7 1 roll exch 4 1 roll exch 6 -1 roll exch 4 2 roll
 8 4 roll 16 4 roll 8 4 roll 20 -4 roll exch 3 1 roll
 4 copy 20 4 roll 4 copy 16 4 roll 4 copy 12 4 roll
 xy4mul 28 4 roll xy4mul 20 4 roll xy4mul 12 4 roll xy4mul}def
}%
\PSdict@{%
 /squineedge{8 2 roll
 exch 5 1 roll 3 -1 roll dup 6 2 roll 1 index exch
 10 -2 roll 2 copy 1 sub neg 4 1 roll 1 sub neg exch 4 1 roll
 xy44mul 4 1 roll pop 5 1 roll 6 1 roll 3 -1 roll pop}def
}%
\PSdict@{%
 /xyshort{2 copy abs exch abs add xysegl .5 mul lt
 {pop pop grestore}{rlineto xystroke}ifelse}def
}%
\PSdict@{%
 /tipwidth{xywidth xycap}def
}%
\PSdict@{%
 /halftip{tipwidth xysize 10 div 0 0 moveto
 -.25 0 3 -1 roll -2.5 mul 0 xysize 2 div neg
 dup .62 mul 2 div neg curveto}bind def
}%
\PSdict@{/atip{gchksavexy halftip xystroke}def}%
\PSdict@{/btip{gchksavexy xyopp halftip xystroke}def}%
\PSdict@{/tip{gchksavexy gsave halftip stroke grestore
 xyopp halftip xystroke}def}%
\PSdict@{%
 /halfcmtip{tipwidth 0 0 moveto
 -.1333 xysize mul 0 .2 xysize mul neg dup .125 xysize mul 
 3 -1 roll .25 xysize mul curveto}bind def
}%
\PSdict@{/cmatip{gchksavexy halfcmtip xystroke}def}%
\PSdict@{/cmbtip{gchksavexy xyopp halfcmtip xystroke}def}%
\PSdict@{/cmtip{gchksavexy gsave halfcmtip stroke grestore
 xyopp halfcmtip xystroke}def}%
\PSdict@{/halfTip{360 32 div neg rotate halftip}bind def}%
\PSdict@{/halfTtip{.31 mul 1 atan rotate halftip}bind def}%
\PSdict@{/aTip{gchksavexy halfTip xystroke}def}%
\PSdict@{/bTip{gchksavexy xyopp halfTip xystroke}def}%
\PSdict@{/Tip{gchksavexy gsave halfTip stroke grestore
 xyopp halfTip xystroke}def}%
\PSdict@{/Ttip{gchksavexy xysegl neg 0 rlineto 0 0 moveto
 gsave -1 halfTtip stroke grestore
 xyopp -1 halfTtip xystroke}def}%
\PSdict@{/halfturn{xysegl 2 div dup dup neg exch rmoveto
 0 exch dup exch -180 -90 arc}bind def}%
\PSdict@{/aturn{gchksavexy halfturn xystroke}def}%
\PSdict@{/bturn{gchksavexy xyopp halfturn xystroke}def}%
\dimen@=\xybsqll@\relax\count@=\dimen@%
\PSdict@{%
 /xysqll \the\count@\space dimendiv def 
 /squigl{gchksavexy xysqll dup neg 0 rmoveto
 2 div dup dup neg dup 3 -1 roll
 2 sqrt mul dup 5 1 roll
 135 45 arcn dup 3 -1 roll -135 -45 arc
 xystroke}def
}%
\PSdict@{/fullhook{0 xysegl 2 div dup -90 90 arcn}bind def}%
\PSdict@{/ahook{gchksavexy fullhook xystroke}def}%
\PSdict@{/bhook{gchksavexy xyopp fullhook xystroke}def}%
\PSdict@{/halfhook{xysegl 2 div dup 0 exch 180 90 arcn}bind def}%
\PSdict@{/hook{gchksavexy gsave halfhook stroke grestore
 xyopp halfhook xystroke}def}%
\PSdict@{%
 /xyqcirc{dup dup neg exch translate newpath 
 dup neg 0 exch moveto 0 0 3 -1 roll -90 0 arc}bind def
}%
\PSdict@{%
 /circ{gstartxy 
 3 copy pop 2 copy cos mul 3 1 roll sin mul
 rmoveto 0 0 5 2 roll arc xystroke}bind def
}%
\PSdict@{%
 /circhar{gsave dup 3 gt{7 sub neg}if dup
 3 eq{pop dup 2 sqrt -2 div mul}{dup 1 eq{pop dup 2 sqrt 2 div mul}
 {0 eq{dup}{0}ifelse}ifelse}ifelse 
 0 translate 3 1 roll circ grestore}bind def
}%
\PSdict@{userdict begin 
 /gray{setgray}bind def /gray@{setgray}bind def
 /rgb{setrgbcolor}bind def /rgb@{setrgbcolor}bind def
 /hsb{sethsbcolor}bind def /hsb@{sethsbcolor}bind def
 /setcmykcolor where{pop}{/setcmykcolor{dup 3 1 roll dup 5 1 roll
 exch sub 1 add 5 1 roll exch sub 1 add 4 1 roll 
 exch sub 1 add 3 1 roll setrgbcolor}bind def}ifelse
 /cmyk{setcmykcolor}bind def /cmyk@{setcmykcolor}bind def
 /sethalftone where{/sethalftone load /tone exch def}if
 end
}%
}\endXYdict@}%
}%
\xyendinput
